package org.papervision3d.events
{
	import flash.events.Event;
	
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.core.geom.Vertex3D;
	import org.papervision3d.core.geom.Face3D;
	import flash.geom.Point;
	import org.papervision3d.core.Number3D;

	public class MouseEvent3D extends Event
	{
		
		public function get pvTarget() : Object {
			return _target;
		}
		
		override public function get currentTarget() : Object {
			return _currentTarget;
		}
		
		override public function get eventPhase() : uint {
			return _eventPhase;
		}
		
		public function get stopped() : Boolean {
			return _stopped;
		}
		
		public function get face() : Face3D {
			return _face;
		}
		
		public function get materialCoordinates() : Point {
			return _materialCoordinates;
		}
		
		
		
		function MouseEvent3D( type : String, target : DisplayObject3D, currentTarget : DisplayObject3D, phase : uint, bubbles : Boolean, position : Vertex3D = null, normal : Number3D = null, face : Face3D = null, materialCoordinates : Point = null ) {
			super( 	type, 
					bubbles, 
					true 
					/* ,bEvent.localX, 
					bEvent.localY,
					null, 
					bEvent.ctrlKey, 
					bEvent.altKey, 
					bEvent.shiftKey, 
					bEvent.buttonDown, 
					bEvent.delta  */
				);
				
			_currentTarget = currentTarget;
			_target = target;
			_eventPhase = phase;
			_face = face;
			_materialCoordinates = materialCoordinates;
			
			this.position = position;
			this.normal = normal;
			
		}
		
		override public function stopPropagation():void {
			_stopped = true;
		}
		

		//_______________________________________________________________
		//														PRIVATES

		private var _target : 			DisplayObject3D;
		private var _currentTarget : 	DisplayObject3D;
		private var _face : 			Face3D;
		private var _materialCoordinates : 			Point;
		private var _eventPhase : 		uint;
		private var _stopped : 			Boolean = false;
		
		public var position : Vertex3D;
		public var normal : Number3D;
		
		
		override public function toString() : String {
			return '[Event type="'+type+'" pvTarget : '+pvTarget+' currentTarget : '+currentTarget+' bubbles='+bubbles+' cancelable='+cancelable+' eventPhase='+eventPhase+']';
		}
	}
}